package cn.sytton.taffe.auth.controller;

import cn.sytton.taffe.auth.service.IProfileService;
import cn.sytton.taffe.framework.security.entity.LoginUser;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Profile控制层
 *
 * @author skyrock
 */
@Tag(name = "登录用户")
@RestController
@RequestMapping("/auth/profile")
public class ProfileController {

    @Resource
    private IProfileService profileService;

    @Operation(summary = "获取当前登录用户信息")
    @GetMapping
    public LoginUser profile(){
        return profileService.profile();
    }
}
